Red Hat JBoss Fuse Integration Partner Day
Charles Moulliard (@cmoulliard)
Principal Solution Architect / Apache Committer - Global Partner Enablement
13th of May - 2014
Red Hat JBoss Fuse Integration Partner Day
Charles Moulliard (@cmoulliard)
Principal Solution Architect / Apache Committer - Global Partner Enablement
13th of May - 2014
A few things about Fuse & OpenSource
Long history behind Fuse
|
Producer sends messages to a queue (using JMS API).
Consumer listens for messages from the queue
Messages are stored until read (or expired)
Messages can be persisted, are read only once.
A client sends message to the topic.
Broker sends message to all subscribers that are currently alive.
Messages are consumed x times (relation 1 to many)
Middleware broker High performance, reliable JMS messaging fabric
Supporting JMS, C, C++, .Net, Stomp, AMQP clients
Protocols : TCP/SSL/HTTP/HTTPS/WebSocket …
High-Availability / Failover
Brokers compete to acquire lock - FS/DB
Forward messages
Loadbalancing, isolate brokers - security, …
An open source messaging platform
DEMO :
Create dynamically a queue
Publish message
|
| |
|
Opensource Java Integration Framework
Designed around Domain Specific Language
Implements Enterprise Integration Patterns
> 50 patterns implemented
and more : Loadbalancer, Throttler, Delayer, …
|
Camel project collection of routes
Route Processors + Interceptors
To trace, log, capture business events
|
|
|
|
Data Transformation for complex use case
package my.cool.demo;
import java.io.InputStream;
import java.io.OutputStream;
import org.apache.camel.Exchange;
public interface DataFormat {
void marshal(Exchange exchange, Object graph, OutputStream stream) throws Exception;
Object unmarshal(Exchange exchange, InputStream stream) throws Exception;
}Marshalling : Object XML (JAXB)
Unmarshalling : XML Object (JAXB)
Fluent API
package my.cool.demo;
import org.apache.camel.builder.RouteBuilder;
public class ExampleRouteBuilder extends RouteBuilder {
@Override
public void configure() throws Exception {
from("amq:queue:quotes")
.filter().xpath("/quote/product/ = 'widget")
.bean("QuotesService", "widget")
.filter().xpath("/quote/product/ = 'gadget")
.bean("QuotesService","gadget");
}
}Alternative : Spring, Blueprint DSL
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
">
<bean id="quotesService" class="my.cool.demo.camel.QuotesService"/>"
<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="amq:queue:quotes"/>
<filter>
<xpath>"/quote/product/ = 'widget"</xpath>
</filter>
<bean id="quotesService" method="widget"/>
<filter>
<xpath>"/quote/product/ = 'gadget"</xpath>
</filter>
<bean id="quotesService" method="gadget"/>
</route>
</camelContext>
</beans>Small bus / alternative to bigger bus like JBI, SCA, NMR
Support object : XML, File, Stream, Bytes
Predicate & Expression language (xslt, xpath, …)
Sync/Async exchanges
Threads Management,
Tx Architecture
Error & exception handling
Policy driven
Container agnostic
Goal Simplify creation & deployment of web/REST services
2 approaches java wsdl or wsdl java
Support :
JAX-WS : Web Services (XML/SOAP)
JAX-RS : REST service (JSON)
SOAP 1.1, 1.2, WSDL 1.1, WS-Security, WS-Addressing, WS-RM
cxf-codegen-plugin & cxf-java2ws-plugin
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>${cxf.version}</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${project.build.directory}/generated/cxf</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>${basedir}/src/main/resources/myService.wsdl</wsdl>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>Define a Camel CXF Endpoint, use it from your camel route <from uri="cxf:bean:reportIncident"/>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:camel="http://camel.apache.org/schema/spring"
xmlns:cxf="http://camel.apache.org/schema/cxf"
...
<cxf:cxfEndpoint id="reportIncident"
address="http://localhost:{{port}}/camel-example/webservices/incident"
wsdlURL="etc/report_incident.wsdl"
serviceClass="org.apache.camel.example.ReportIncidentEndpoint"/>
...
<route>
<from uri="cxf:bean:reportIncident"/>
<convertBodyTo type="org.apache.camel.example.reportincident.InputReportIncident"/>
<transform>
<method bean="responseBean" method="getOK"/>
</transform>DEMO :
Camel & WebService
Enables integration & Mediation everywhere for a real-time enterprise
Java OSGI Runtime
Offer modularity for Integration
Multi-Technology platform
Technology Camel, CXF, ActiveMQ, Spring, Fabric, …
Modular platform deploy or remove container/libraries
SSH server
Allow to administrate/create instances
Provide provisioning solution features
Hot deployment
Configure & manage instances
Security integration - JAAS
DEMO :
Admin
Provisioning
Camel routes isolated from each other (classloader)
Bundle CamelContext boundaries Local BUS
Camel routes can have different SLA (Threads, Policies, …)
Camel routes can be started/stopped/updated
Simplify maintenance process
New routes can be hot deployed
Like also "Beans/POJO, Web Services, …"
DEMO :
Hot Deployment
|
|
Do you support such ecosystem ?
How can we manage hybrid inf. (config, ip, provisioning) ?
Opensource integration project - http://fabric8.io
Mission Easy to deploy your java integration solutions and services on a number of machines, processes and JVMs
Manage container creation (locally, remotely, cloud, openshift, docker, …)
Visualise what is running to understand your platform
Monitor whats running and easily scaling up or down specific profiles
Make configuration, composition or version changes in an all-in-one approach or via rolling upgrades
Virtualize services (endpoints), processes
Search and storage engine (insight) for logs, metrics
|
Instances are not cloned
Configurations must be managed (manually, script)
Rely on Zookeeper server (ensemble of 1,3, 5 or servers)
Coordinating distributed systems in a reliable way (electing leaders, implementing master/slave, sharding or federation of services).
Are the clients of the Zookeeper server(s)
They will communicate with Zk server to :
register container info (ports, services, endpoints, processes)
get their provisioning
Behavior of a container
Envelope(s) containing artifacts to be deployed, parameters (system, jvm, services) to be configured
Can be versioned, facilitate mngt - rollback
Create indirection points, Easy elastic scaling of services (Camel, CXF, …)
New topologies (Replicated - LevelDB storage, NPlus1),
Broker discovery
Fabric Insight Technology
NoSQL storage for JSon documents
Based on ElasticSearch
Kibana is the web front end
Full Text Search features
|
|
JBoss Fuse | POJO + Messaging + Web |
JBoss A-MQ | High Availability with Network of Brokers |
JBoss Fuse + Fabric | Virtualization of Camel endpoints / loadbalancing |
|
More info
www.jboss.org/products/fuse.html
www.redhat.com/products/jbossenterprisemiddleware/fuse/